package com.kgc.scd.service.impl;

import com.kgc.scd.bean.User;
import com.kgc.scd.bean.Vip;
import com.kgc.scd.bean.VipExample;
import com.kgc.scd.mapper.UserMapper;
import com.kgc.scd.mapper.VipMapper;
import com.kgc.scd.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created On : 2022/6/15.
 * <p>
 * Author     : 98730
 * <p>
 * Description: UserServiceImpl
 */
@Slf4j
@Service
public class UserServiceImpl implements UserService {

    @Autowired(required = false)
    VipMapper vipMapper;

    @Autowired(required = false)
    UserMapper userMapper;

    @Override
    public List<Vip> selectVipLevelByUserId(String userId) {
        VipExample vipExample = new VipExample();
        VipExample.Criteria criteria = vipExample.createCriteria();
        criteria.andUserIdEqualTo(userId);
        return vipMapper.selectByExample(vipExample);
    }

    @Override
    public User selectUserById(String userId) {
        return userMapper.selectByPrimaryKey(userId);
    }

}
